package tyk.aop.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(1)
public class aop {

    @Pointcut("execution(* tyk.aop.service.impl.UserServiceImpl.*(..))")
    public void pc(){}

    @Before("pc()")
    public void before(){
        System.out.println("执行前置方法...");
    }

    @After("pc()")
    public void after(){
        System.out.println("执行后置方法...");
    }

    @Around("pc()")
    public Object cs(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("执行Around的前置方法");
        Object object = joinPoint.proceed();
        System.out.println("执行Around的后置置方法");
        return object;
    }

}
